Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for missing value interpretation #428

Conversation

alvarowolfx
Copy link
Contributor

Fixes #426 🦕

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. labels Mar 13, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Mar 15, 2024
@alvarowolfx alvarowolfx marked this pull request as ready for review March 15, 2024 20:17
@alvarowolfx alvarowolfx requested a review from a team as a code owner March 15, 2024 20:17
@alvarowolfx alvarowolfx added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 15, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 15, 2024
Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this handwritten allow MVI changes when writes have already begun, or are the options locked at the outset only?

const protoDescriptor: DescriptorProto =
adapt.convertStorageSchemaToProto2Descriptor(storageSchema, 'root');

// Row 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These sample rows are confusing, as the row data isn't compatible with the updatedSchema above. If you're wanting empty rows that's fine, just describe what you're doing so the interaction is clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed some updates to the test to make the full schema more explicit. The idea here is to send rows with some empty values and show that they are being filled or not accordingly to the MVI settings.

@alvarowolfx alvarowolfx changed the title feat: add support for default value interpretation feat: add support for missing value interpretation Mar 18, 2024
@alvarowolfx
Copy link
Contributor Author

Does this handwritten allow MVI changes when writes have already begun, or are the options locked at the outset only?

Both Writer and JSONWriter have the methods setDefaultMissingValueInterpretation and setMissingValueInterpretations to change MVI after the writer is already started.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Mar 20, 2024
@alvarowolfx alvarowolfx added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 20, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 20, 2024
@@ -88,6 +87,30 @@ export class JSONWriter {
this._encoder.setProtoDescriptor(protoDescriptor);
}

/**
* Update how missing values are interpreted by for the given stream.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the 'by' is extra in there.

protoDescriptor: IDescriptorProto;

/**
* Controls how missing values are interpreted by for a given stream.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has the extra 'by' too.

@@ -72,6 +126,28 @@ export class Writer {
}
}

/**
* Update how missing values are interpreted by for the given stream.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another 'by'

Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, comment nits seem to be the last bit to address.

I do wish the assertion support was better here and isnull/notnull were first class assertions, but alas.


/**
* Controls how missing values are interpreted by for a given stream.
* `missingValueInterpretations` set for individual colums can override the default chosen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/colums/columns/

@alvarowolfx alvarowolfx added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 21, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 21, 2024
@alvarowolfx alvarowolfx added automerge Merge the pull request once unit tests and other checks pass. owlbot:run Add this label to trigger the Owlbot post processor. labels Mar 21, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 21, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit 1a3e4ba into googleapis:main Mar 21, 2024
14 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default expression does not work
3 participants